package com.godGuang.controller;

import com.godGuang.common.core.domain.Result;
import com.godGuang.domain.Catalogue;
import com.godGuang.servser.DepartmentService;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author : 段敏强
 * @className : DepartmentAddition
 * @description : 描述说明该类的功能
 * @createTime : 2024/01/08 11:58
 */


/**
 * 科室controller 接口
 */


@RestController
@RequestMapping("/department")
@Log4j2
public class DepartmentAdditionController {

    /**
     * 科室service
     */
    @Autowired
    private DepartmentService departmentService;




    /**
     * 获取科室列表
     *
     * @return 科室列表
     */
    @PostMapping("/departmentList")
    public Result<List<Catalogue>> departmentList(){

        log.info("获取科室列表");
        // 调用service获取科室列表
        List<Catalogue> departmentType =  departmentService.departmentList();
        log.info("获取科室列表成功");
        // 返回科室列表
        return Result.success(departmentType);
    }

}
